package wyu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import wyu.service.UserPostSubService;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user-post-sub")
public class UserPostSubController {
    @Resource
    UserPostSubService userPostSubService;
    @GetMapping("/getSubCount")
    public int getSubCount (@RequestParam("postId")int postId){
        return userPostSubService.query().eq("POST_ID",postId).count();
    }
}
